cmake_minimum_required(VERSION 3.10)  # 要求 CMake 3.10+
project(esdf_map_demo LANGUAGES CXX CUDA)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 设置全局优化级别
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")

# 设置 CUDA 标准
set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)

set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -Xcudafe --diag_suppress=20236") # 抑制编号为20236的警告

message(STATUS "C++ Standard: ${CMAKE_CXX_STANDARD}")
message(STATUS "C++ Flags: ${CMAKE_CXX_FLAGS}")

find_package(CUDAToolkit REQUIRED)
include_directories(${CUDA_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR})  # 添加全局头文件搜索路径

add_subdirectory(gpu)
add_executable(esdf_map_demo 
               main.cpp)

target_link_libraries(esdf_map_demo 
                      CUDA::cudart 
                      ${CUDA_cublas_LIBRARY}
                      gpu_library)
